var mongoose = require('mongoose');

var buyItemSchema = mongoose.Schema({
	  ing:{
		  type : String,
		  ref : 'ingredients'
	  },
	  sl:Number,
	  dj:Number,
	  zj:Number
});

var schema = mongoose.Schema({
	  userid : String,
	  name : String,
	  price:Number,
	  items:[buyItemSchema],
	  time:Date
});


var Purchase=mongoose.model('purchases', schema);

module.exports = Purchase;


